package com.fjec.user.wechat;

// https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/login/auth.code2Session.html
public class WeChatConst {
    public static String OpenIdUrl = "https://api.weixin.qq.com/sns/jscode2session?";

    public static String AppId = "wx525f2c0776872dc2";

    public static String AppSecret = "52c3307f41a85e304b3579c7cfe1a7ad";

    public static String getUrl(String jscode) {
        StringBuilder sb = new StringBuilder();
        sb.append(OpenIdUrl)
                .append("appid=").append(AppId)
                .append("&secret=").append(AppSecret)
                .append("&js_code=").append(jscode)
                .append("&grant_type=authorization_code");

        return sb.toString();
    }
}
